package com.proxy.JdkProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JdkHandler implements InvocationHandler {
    private Object target;

    public JdkHandler(Object target) {
        this.target = target;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("调用方法前----调用方法=" + method.getName());
        Object invoke = method.invoke(this.target, args);
        System.out.println("调用方法后----调用方法=" + method.getName());
        return invoke;
    }
}